package util.content;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;


public class XMLUtil {

	public void xmlReader() {
		SAXBuilder builder = new SAXBuilder(false);
		List<?> sourceSiteParameterList = null;
		Document doc2;

		try {
			doc2 = builder.build("keywordComplex.xml");
			Element parameter = doc2.getRootElement();
			sourceSiteParameterList = parameter.getChildren("select");
			for (Iterator<?> iter = sourceSiteParameterList.iterator(); iter.hasNext();) {
				Element sourceSiteParameter = (Element) iter.next();
				dbhost = sourceSiteParameter.getChildTextTrim("dbhost");
				dbName = sourceSiteParameter.getChildTextTrim("dbName");
			}
		} catch (JDOMException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	String dbhost = null;

	public String getDbhost() {
		System.out.println(dbhost);
		return dbhost;
	}

	public String getDbName() {
		System.out.println(dbName);
		return dbName;
	}

	String dbName = null;
}
